Documentation for class polygon

Inherits from 	polyline_object 

Properties declared in polygon 
	fill_color 
	fill_rule 

Class Methods declared in polygon 
	new(points) 

Methods declared in polygon 
	any 
		fill_color 
		fill_rule 
		set_fill_color(color) 
		set_fill_rule(rule) 
	get 
		fill_color 
		fill_rule 
	set 
		set_fill_color(color) 
		set_fill_rule(rule) 

Class 
#begin_class
polygon 
The class polygon is a subclass of the class polyline_object. 
A polygon is a polyline_object that is closed, i.e. the last point is connected to the first point. 
A polygon has a fill-color and a fill-rule.
#end_class

Properties 

#begin_property
fill_color 
Stores the color object for the polygons fill-color.
#end_property

#begin_property
fill_rule 
Stores the fill-rule of the polygon. The different fill-rules are:
#non_zero
#even_odd
Default is #non_zero.
#end_property

Methods 

#begin_method
fill_color 
Returns the fill_color property of the polygon.
#end_method

#begin_method
fill_rule 
Returns the fill_rule property of the polygon.
#end_method

#begin_method
set_fill_color(color) 
Sets the fill_color property to color.
Returns self.
Ex:
This example creates a new polygon and sets its fill-color to green:
p := {polygon}:new([{0 0} {20 20} {50 23}])
c := {color}:new
c:set_rgba(0, 1, 0, 1)
p:set_fill_color(c)
#end_method

#begin_method
set_fill_rule(rule) 
Sets the fill_rule property to rule.
The different fill-rules are:
#non_zero
#even_odd
Returns self.
#end_method

Class Methods 

#begin_class_method
new(points) 
Returns a new polygon object.
Ex:
{polygon}:new([{10 10} {10 100} {100 120}])
will create a new polygon with three points.
Note: You cannot create a polygon with less than three points.
#end_class_method